<template>
	<!-- 面包屑 -->
	<div class="crumbs">
		<i class="EachApp EachApp_guanbi" @click="backPath ? router.push(backPath) : router.back()" v-if="route.meta?.isBack"></i>
		<i :class="['EachApp initial', `${route.meta.icon}`]" v-else></i>
		{{ route.meta?.title }}
	</div>
	<!-- 搜索框 -->
	<ComSearch @handle-search="emit('handleSearch', $event)" ref="ComSearchRef" v-if="isSearch"/>
	<!-- 按钮 -->
	<div class="btns">
		<i class="EachApp EachApp_jian1 hover" v-if="isAdd"></i>
		<slot name="btns"></slot>
	</div>
</template>
<script lang="ts" setup>
defineProps({
	backPath: { type: String, default: () => { return '' } }, // 返回路径
	isSearch: { type: Boolean, default: () => { return true } }, // 是否展示搜索框
	isAdd: { type: Boolean, default: () => { return false } }, // 是否展示按钮
})
const route = useRoute();
const router = useRouter();
const emit = defineEmits(['handleSearch']);
</script>
